<template>
    <div>
        <div class="big-data-container">
            <div class="header"><span>主体管理实时统计</span></div>
            <div class="chart-body">
                <div class="body-item">
                    <div class="car-icon"></div>
                    <div class="body-right">
                        <div class="title-text">车辆</div>
                        <div class="bottom-text">
                            <div class="number-text" style="color: #FEE400;">{{countNumber.vehicleCnt}}</div>
                            <div class="unit-text">辆</div>
                        </div>
                    </div>
                </div>
                <div class="body-item">
                    <div class="enterprise-icon"></div>
                    <div class="body-right">
                        <div class="title-text">运输企业</div>
                        <div class="bottom-text">
                            <div class="number-text" style="color: #21CAFF;">{{countNumber.enterpriseCnt}}</div>
                            <div class="unit-text">家</div>
                        </div>
                    </div>
                </div>
                <div class="body-item">
                    <div class="driver-icon"></div>
                    <div class="body-right">
                        <div class="title-text">驾驶员</div>
                        <div class="bottom-text">
                            <div class="number-text" style="color: #25E9A7;">{{countNumber.driverCnt}}</div>
                            <div class="unit-text">人</div>
                        </div>
                    </div>
                </div>
                <div class="body-item">
                    <div class="site-icon"></div>
                    <div class="body-right">
                        <div class="title-text">消纳场数</div>
                        <div class="bottom-text">
                            <div class="number-text" style="color: #D100FE;">{{countNumber.disposalSiteCnt}}</div>
                            <div class="unit-text">个</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import {boardQueryRelCnt} from '../../api/board'

export default {
    name: 'leftChart1',
    data(){
        return{
            countNumber:{
                vehicleCnt:0,
                enterpriseCnt:0,
                driverCnt:0,
                disposalSiteCnt:0
            }
        }
    },
    methods:{
        getData(){
            const param = {}
            boardQueryRelCnt(param).then(response => {
                this.countNumber = response.data.data
            }).catch(error => {
                console.log(error)
            })
        }
    },
    mounted () {
        this.getData()
    }
}
</script>

<style scoped lang="scss">
.big-data-container{
    width: 394px;
    height: 216px;
    background: url("/static/img/left_chart_1_bg.png") no-repeat;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 1;
    .header{
        width: 367px;
        height: 46px;
        background: url("/static/img/chart_header.png") no-repeat;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        span{
            color: #FFFFFF;
            font-size: 15px;
            margin-left: 26px;
            margin-top: 5px;
        }
    }

    .chart-body{
        width: 100%;
        height: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fill, 50%);
        grid-template-rows: repeat(auto-fill, 50%);


        .body-item{
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;

            .car-icon{
                width: 59px;
                height: 59px;
                background: url("/static/img/chart_car_icon.png") no-repeat;
            }

            .enterprise-icon{
                width: 59px;
                height: 59px;
                background: url("/static/img/chart_enterprise_icon.png") no-repeat;
            }

            .driver-icon{
                width: 59px;
                height: 59px;
                background: url("/static/img/chart_driver_icon.png") no-repeat;
            }

            .site-icon{
                width: 59px;
                height: 59px;
                background: url("/static/img/chart_site_icon.png") no-repeat;
            }

            .body-right{
                width: 120px;
                height: 100%;
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                justify-content: center;
                margin-left: 10px;

                .title-text{
                    font-size: 16px;
                    color: #FFFFFF;
                }
                .bottom-text{
                    display: flex;
                    flex-direction: row;
                    align-items: center;
                    justify-content: center;
                    .number-text{
                        font-size: 20px;
                        font-weight: bolder;
                    }
                    .unit-text{
                        color: #FFFFFF;
                        font-size: 12px;
                    }
                }
            }

        }
    }

}
</style>
